<?php

/*

   Aiesec's Alumni System - to manage data about Aiesec's Alumni and
   optimize the knowledge exchange between old and new members.
   Copyright (C) 2009 Vinicius Stein Dani

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

/*
  
   Author: Vinicius Stein Dani
   Contact: viniciussdani@gmail.com
   Today is: May 25, 2009
   Location at this present moment: Santa Maria - RS - Brasil
  
*/

?>

<?php

  if(isset($_POST['esqueci_senha']) && $_POST['esqueci_senha'] == "Enviar senha")
  {
    $login = $_POST['login'];
    
    $a = mysql_query("SELECT senha FROM person WHERE email = '$login'");
    $b = mysql_fetch_array($a);
    
    $senha = $b['senha'];
    
    include_once '_v_esqueci_senha_confirma.php';
  }
  else
  {
    $esqueci_senha = "
        
    <table>
      <tr>
        <td>
          <form action=\"\" method=\"post\">
            Login: <input type=\"text\" name=\"login\" />
            <input type=\"submit\" name=\"esqueci_senha\" value=\"Enviar senha\" 
             style=\"background-color: #000000; font-family: verdana, arial, tahoma; font-size: 10px; color: #FFFFFF; height: 20px; border: 0px;\" />
          </form>
        </td>
      </tr>
    </table>
    
    ";

    echo $esqueci_senha;
  }
?>